﻿// See https://aka.ms/new-console-template for more information

// 项目1

using colectionDemo.jobs;

/*var listDemo1 = new ListDemo();
listDemo1.Run();*/

/*var dicDemo1 = new DicDemo();
dicDemo1.Run();*/

/*var libraryCatalog = new LibraryCatalog();
libraryCatalog.AddBookToCategory("计算机", "C#开发指南1");
libraryCatalog.AddBookToCategory("计算机", "C#开发指南2");
libraryCatalog.AddBookToCategory("计算机2", "开发指南1");
libraryCatalog.AddBookToCategory("计算机2", "开发指南2");
libraryCatalog.AddBookToCategory("计算机2", "开发指南3");

libraryCatalog.ListBookInCategory("计算机");

libraryCatalog.ListBookInCategory("计算机2");

libraryCatalog.ListAllCategoryBooks();*/

/* hashset 去重、交集、 并集 */
int[] a = [1,2,4,5,7];
int[] b = [1,2,3,6,9];
HashSet<int> h1 = new HashSet<int>(a);
h1.UnionWith(b);
Console.WriteLine("并集："+string.Join(",",h1));

HashSet<int> h2 = new HashSet<int>(a);
h2.IntersectWith(b);
Console.WriteLine("交集："+string.Join(",",h2));

HashSet<int> h3 = new HashSet<int>(a);
h3.ExceptWith(b);
Console.WriteLine("差集："+string.Join(",",h3));
